﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _15_TreeView
{
    public partial class Frm_AddNode : Form
    {
        /// <summary>
        /// 节点名称
        /// </summary>
        public string NodeName { get; set; }

        public Frm_AddNode()
        {
            InitializeComponent();
        }

        public Frm_AddNode(string nodeName):this()
        {
            this.textBox1.Text = nodeName;
            this.button1.Text = "确认修改";
        }

        /// <summary>
        /// 确认按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            this.NodeName = this.textBox1.Text;
            this.DialogResult = DialogResult.OK;
        }
    }
}
